import java.util.concurrent.Semaphore;

public class ThreadDemo7 {
    public static void main(String[] args) throws InterruptedException {
        Semaphore semaphore = new Semaphore(2);
        semaphore.acquire();
        System.out.println("1");
        semaphore.acquire();
        System.out.println("2");
        semaphore.acquire();
        System.out.println("3");
    }
}
